package com.sx.pipeline.repos.http

import com.sx.pipeline.app.config.BaseEntity
import com.sx.pipeline.repos.http.impl.IBusinessSource
import com.sx.pipeline.repos.http.impl.IMapSource
import com.sx.pipeline.repos.http.impl.IWorkBenchSource
import com.sx.pipeline.repos.http.req.AddAdministrativeDTO
import com.sx.pipeline.repos.http.req.AddBankDTO
import com.sx.pipeline.repos.http.req.AddInquiryDTO
import com.sx.pipeline.repos.http.req.AddQuotedPriceDTO
import com.sx.pipeline.repos.http.req.AuditTaskDTO
import com.sx.pipeline.repos.http.req.BindPhoneDTO
import com.sx.pipeline.repos.http.req.CreateGroupDTO
import com.sx.pipeline.repos.http.req.DealTaskDTO
import com.sx.pipeline.repos.http.req.EquipmentAddDTO
import com.sx.pipeline.repos.http.req.GoodsAddDTO
import com.sx.pipeline.repos.http.req.LoginDTO
import com.sx.pipeline.repos.http.req.MessageDTO
import com.sx.pipeline.repos.http.req.ModifyPwdDTO
import com.sx.pipeline.repos.http.req.RegisterDTO
import com.sx.pipeline.repos.http.req.ReleaseNeedsAddDTO
import com.sx.pipeline.repos.http.req.ReqGroupReportDTO
import com.sx.pipeline.repos.http.req.ReqUserReportDTO
import com.sx.pipeline.repos.http.req.ResetUserDTO
import com.sx.pipeline.repos.http.req.ServiceAddDTO
import com.sx.pipeline.repos.http.req.SupplyOrderAddDTO
import com.sx.pipeline.repos.http.req.TaskAddDTO
import com.sx.pipeline.repos.http.req.TaskCreateGroupDTO
import com.sx.pipeline.repos.http.req.TaskDelayDTO
import com.sx.pipeline.repos.http.req.TaskEvaluateDTO
import com.sx.pipeline.repos.http.req.WithdrawDTO
import com.sx.pipeline.repos.http.res.AdvertiseDetailVO
import com.sx.pipeline.repos.http.res.AdvertiseVO
import com.sx.pipeline.repos.http.res.AgreementVO
import com.sx.pipeline.repos.http.res.AliPayResponse
import com.sx.pipeline.repos.http.res.BalanceRecordVO
import com.sx.pipeline.repos.http.res.BankListVO
import com.sx.pipeline.repos.http.res.ContactUserVo
import com.sx.pipeline.repos.http.res.DeviceInfoVo
import com.sx.pipeline.repos.http.res.ExamineInfoVo
import com.sx.pipeline.repos.http.res.ExamineOperatorVo
import com.sx.pipeline.repos.http.res.ExamineRecordVo
import com.sx.pipeline.repos.http.res.GoodsInfoVo
import com.sx.pipeline.repos.http.res.GroupDetailVo
import com.sx.pipeline.repos.http.res.Ipage
import com.sx.pipeline.repos.http.res.LoginVO
import com.sx.pipeline.repos.http.res.MessageDetailVo
import com.sx.pipeline.repos.http.res.MessageListVo
import com.sx.pipeline.repos.http.res.MessageTypeVo
import com.sx.pipeline.repos.http.res.NeedsQuotedVO
import com.sx.pipeline.repos.http.res.ProvincesVO
import com.sx.pipeline.repos.http.res.RechargeInfoVO
import com.sx.pipeline.repos.http.res.ReleaseNeedsVO
import com.sx.pipeline.repos.http.res.ReleaseSupplyVo
import com.sx.pipeline.repos.http.res.ReleaseTaskVo
import com.sx.pipeline.repos.http.res.RongGroupVO
import com.sx.pipeline.repos.http.res.RyUserVo
import com.sx.pipeline.repos.http.res.ServiceTitleVO
import com.sx.pipeline.repos.http.res.StudyCenterVO
import com.sx.pipeline.repos.http.res.SupplyDetailVo
import com.sx.pipeline.repos.http.res.TaskConfigVo
import com.sx.pipeline.repos.http.res.TaskContactVo
import com.sx.pipeline.repos.http.res.TaskDetailVo
import com.sx.pipeline.repos.http.res.TaskEvaluateVO
import com.sx.pipeline.repos.http.res.TaskGroupVO
import com.sx.pipeline.repos.http.res.UnitNameVO
import com.sx.pipeline.repos.http.res.UnitTypeVO
import com.sx.pipeline.repos.http.res.UserInfoVO
import com.sx.pipeline.repos.http.res.UserUnitVo
import com.sx.pipeline.repos.http.res.VersionUpdateVO
import com.sx.pipeline.repos.http.res.ViewInquiryVo
import com.sx.pipeline.repos.http.res.WechatResponse
import com.sx.pipeline.repos.http.res.WithdrawRecordVO
import com.sx.pipeline.view.treeview2.OrganizeDeptRes
import io.reactivex.rxjava3.core.Observable
import java.io.File

/**
 * @Author: YY
 * @Date: 2022/4/5
 * @Description: Http数据源
 */
interface IHttpSource : IWorkBenchSource, IBusinessSource, IMapSource {

    /**
     * 获取省市区数据
     */
    fun getProvinces(): Observable<BaseEntity<List<ProvincesVO>>>

    /**
     * 查询单位类型
     */
    fun queryUnitType(identityID:Int?=null): Observable<BaseEntity<List<UnitTypeVO>>>


    /**
     * 查询单位名称
     */
    fun getUnitNameList(
        name: String? = null,
        areaId: Int = 0,
        typeAttribute: String? = null,
        unitTypeId: String? = null,
        identity: Int,
        isPage: Boolean = true,
        page: Int = 1,
        limit: Int = 10,
    ): Observable<BaseEntity<Ipage<UnitNameVO>>>

    /**
     * 注册 查询单位名称
     */
    fun getRegUnitNameList(
        name: String? = null,
        areaId: Int = 0,
        typeAttribute: String? = null,
        unitTypeId: String? = null,
        identity: Int,
        isPage: Boolean = true,
        page: Int = 1,
        limit: Int = 10,
    ): Observable<BaseEntity<Ipage<UnitNameVO>>>

    /**
     * 注册发送验证码
     */
    fun sendSmsCode(phone: String, type: Int?): Observable<BaseEntity<Boolean>>

    /**
     * 协议内容
     */
    fun getAgreement(id: Long): Observable<BaseEntity<AgreementVO>>

    /**
     * 注册
     */
    fun register(dto: RegisterDTO): Observable<BaseEntity<Boolean>>

    /**
     * 登录
     */
    fun login(dto: LoginDTO): Observable<BaseEntity<LoginVO>>

    /**
     * 注销账号
     */
    fun cancelAccount(): Observable<BaseEntity<Any>>

    /**
     * 绑定手机号
     */
    fun bindPhone(dto: BindPhoneDTO): Observable<BaseEntity<LoginVO>>

    /**
     * 修改密码
     * TODO:0:修改密码，1:修改支付密码
     */
    fun modifyPassword(dto: ModifyPwdDTO): Observable<BaseEntity<Boolean>>

    /**
     * 获取用户信息
     */
    fun getUserInfo(): Observable<BaseEntity<UserInfoVO>>

    /**
     * 获取通知类型列表
     */
    fun getNoticeTypeList(): Observable<BaseEntity<List<MessageTypeVo>>>

    /**
     * 根据类型获取消息列表
     */
    fun getNoticeByCode(code: Int, page: Int): Observable<BaseEntity<Ipage<MessageListVo>>>

    /**
     * 获取消息详情
     */
    fun getNoticeDetail(dto: MessageDTO): Observable<BaseEntity<MessageDetailVo>>

    /**
     * 获取任务配置数据
     */
    fun getTask(): Observable<BaseEntity<TaskConfigVo>>

    /**
     * 获取单位下所有联系人
     */
    fun getContacts(): Observable<BaseEntity<List<TaskContactVo>>>

    /**
     * 全部已读
     */
    fun getAllHaveRead(): Observable<BaseEntity<Boolean>>

    /**
     * 发布任务
     */
    fun getTaskAdd(dto: TaskAddDTO): Observable<BaseEntity<TaskGroupVO>>

    /**
     * 获取任务配置数据
     */
    fun getNeed(): Observable<BaseEntity<TaskConfigVo>>

    /**
     * 图片上传
     */
    fun uploadImage(file: File): Observable<BaseEntity<String>>

    /**
     * 获取任务发布列表
     */
    fun putTaskList(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseTaskVo>>>

    /**
     * 取消任务
     */
    fun getCancelTask(id: Int): Observable<BaseEntity<Any>>


    /**
     * 结束任务
     */
    fun getEndTask(id: Int): Observable<BaseEntity<Any>>

    /**
     * 删除任务
     */
    fun getRemoveTask(id: Int): Observable<BaseEntity<Any>>

    /**
     * 任务延期
     */
    fun getTaskDelay(dto: TaskDelayDTO): Observable<BaseEntity<Any>>

    /**
     * 加入群聊
     */
    fun requestJoinGroup(id: Int): Observable<BaseEntity<Any>>

    /**
     * 获取我参与的任务列表
     */
    fun takePartTaskList(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseTaskVo>>>

    /**
     * 获取我审批的任务
     */
    fun auditTaskList(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseTaskVo>>>

    /**
     * 审批任务
     */
    fun getTaskAudit(dto: AuditTaskDTO): Observable<BaseEntity<TaskGroupVO>>

    /**
     * 处理任务
     */
    fun dealWithTask(dto: DealTaskDTO): Observable<BaseEntity<Any>>

    /**
     * 获取登录单位信息
     */
    fun getUserUnit(): Observable<BaseEntity<UserUnitVo>>

    /**
     * 获取任务详情
     */
    fun getTaskDetail(id: Int): Observable<BaseEntity<TaskDetailVo>>

    /**
     * 获取供应配置数据
     */
    fun getSupply(): Observable<BaseEntity<TaskConfigVo>>

    /**
     * 添加设备台账
     */
    fun equipmentAdd(dto: EquipmentAddDTO): Observable<BaseEntity<Any>>

    /**
     * 编辑设备台账
     */
    fun equipmentEdit(dto: EquipmentAddDTO): Observable<BaseEntity<Any>>

    /**
     * 添加设备列表
     */
    fun getEquipmentList(
        key: String,
        page: Int,
    ): Observable<BaseEntity<Ipage<DeviceInfoVo>>>

    /**
     * 服务标题列表
     */
    fun getServiceTitle(
    ): Observable<BaseEntity<List<ServiceTitleVO>>>

    /**
     * 获取服务设备列表
     */
    fun getPmsServiceList(
        key: String,
        page: Int,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<ServiceAddDTO>>>

    /**
     * 台账设备详情
     */
    fun getDeviceDetail(id: Int): Observable<BaseEntity<DeviceInfoVo>>

    /**
     * 删除台账设备
     */
    fun getEquipmentDelete(id: Int): Observable<BaseEntity<Any>>

    /**
     * 添加供应
     */
    fun supplyOrderAdd(dto: SupplyOrderAddDTO): Observable<BaseEntity<Any>>

    /**
     * 获取我发布的供应列表
     */
    fun pushSupplyPage(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseSupplyVo>>>

    /**
     * 获取产品配置数据
     */
    fun getProduct(): Observable<BaseEntity<TaskConfigVo>>

    /**
     * 添加商品
     */
    fun productAdd(dto: GoodsAddDTO): Observable<BaseEntity<Any>>

    /**
     * 编辑商品
     */
    fun productEdit(dto: GoodsAddDTO): Observable<BaseEntity<Any>>

    /**
     * 获取商品列表
     */
    fun getProductList(
        key: String,
        page: Int,
    ): Observable<BaseEntity<Ipage<GoodsInfoVo>>>

    /**
     * 获取广告宣传 单位 商品列表
     */
    fun getAdvertisingDetail(
        unitId: Int,
        page: Int,
    ): Observable<BaseEntity<AdvertiseDetailVO>>

    /**
     * 删除商品
     */
    fun deleteProduct(id: Int): Observable<BaseEntity<Any>>


    /**
     * 商品详情
     */
    fun getGoodsDetail(id: Int): Observable<BaseEntity<GoodsInfoVo>>

    /**
     * 获取审批供应列表
     */
    fun auditSupplyList(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseSupplyVo>>>


    /**
     * 审批供应
     */
    fun getSupplyAudit(dto: AuditTaskDTO): Observable<BaseEntity<Any>>

    /**
     * 供应商品详情
     */
    fun getSupplyOrderDetail(id: Int): Observable<BaseEntity<SupplyDetailVo>>

    /**
     * 参与供应分页列表
     */
    fun takePartSupplyList(
        key: String,
        page: Int,
        isPage: Boolean = true,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<ReleaseSupplyVo>>>

    /**
     * 施工单位添加询价
     */
    fun addInquiry(dto: AddInquiryDTO): Observable<BaseEntity<Any>>

    /**
     * 询价列表
     */
    fun getInquiryList(orderId: Int): Observable<BaseEntity<List<ViewInquiryVo>>>

    /**
     * 取消供应
     */
    fun cancelSupplyOrder(id: Int): Observable<BaseEntity<Any>>

    /**
     * 删除供应
     */
    fun deleteSupplyOrder(id: Int): Observable<BaseEntity<Any>>

    /**
     * 取消需求
     */
    fun cancelNeedOrder(id: Int): Observable<BaseEntity<Any>>

    /**
     * 删除需求
     */
    fun deleteNeedOrder(id: Int): Observable<BaseEntity<Any>>

    /**
     * 发布需求
     */
    fun addNeedOrder(dto: ReleaseNeedsAddDTO): Observable<BaseEntity<Int>>

    /**
     * 获取施工单位 我参与的需求列表
     */
    fun operationPushNeedPage(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseNeedsVO>>>

    /**
     * 施工单位 发布需求
     */
    fun addConstructionNeedOrder(dto: ReleaseNeedsAddDTO): Observable<BaseEntity<Any>>

    /**
     * 施工单位 发布需求重新提交
     */
    fun editConstructionNeedOrder(dto: ReleaseNeedsAddDTO): Observable<BaseEntity<Any>>


    /**
     *  获取施工单位/供应商 我参与的需求列表
     */
    fun takePartNeedPage(
        key: String,
        page: Int,
        isPage: Boolean = true,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<ReleaseNeedsVO>>>


    /**
     * 获取施工单位 发布的需求列表
     */
    fun pushNeedPageList(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseNeedsVO>>>

    /**
     * 获取施工单位 审批的需求列表
     */
    fun auditNeedPage(
        status: Int,
        page: Int,
    ): Observable<BaseEntity<Ipage<ReleaseNeedsVO>>>


    /**
     * 审批需求
     */
    fun getNeedOrderAudit(dto: AuditTaskDTO): Observable<BaseEntity<Any>>

    /**
     * 获取需求详情
     */
    fun getNeedOrderDetail(id: Int): Observable<BaseEntity<ReleaseNeedsVO>>


    /**
     * 获取学习中心列表
     */
    fun getLearningStudy(
        isPage: Boolean = true, page: Int = 1, limit: Int = 10
    ): Observable<BaseEntity<Ipage<StudyCenterVO>>>

    /**
     * 修改用户信息
     */
    fun updateUser(dto: ResetUserDTO): Observable<BaseEntity<Any>>

    /**
     * 获取学习中心列表
     */
    fun getAdvertiseList(
        isPage: Boolean = true, page: Int = 1, limit: Int = 10
    ): Observable<BaseEntity<Ipage<AdvertiseVO>>>

    /**
     * 供应商添加报价
     */
    fun addQuotedPrice(dto: AddQuotedPriceDTO): Observable<BaseEntity<Any>>

    /**
     * 查看报价
     */
    fun getQuotedPrice(id: Int): Observable<BaseEntity<List<NeedsQuotedVO>>>

    /**
     * 任务评价
     */
    fun addTaskEvaluate(dto: List<TaskEvaluateDTO>): Observable<BaseEntity<Any>>

    /**
     * 任务评价列表
     */
    fun getEvaluate(id: Int): Observable<BaseEntity<List<TaskEvaluateVO>>>

    /**
     * 添加服务设备
     */
    fun addServiceDevice(dto: ServiceAddDTO): Observable<BaseEntity<Any>>

    /**
     * 编辑服务设备
     */
    fun editServiceDevice(dto: ServiceAddDTO): Observable<BaseEntity<Any>>


    /**
     * 服务台账设备详情
     */
    fun getServiceDeviceDetail(id: Int): Observable<BaseEntity<ServiceAddDTO>>

    /**
     * 删除服务台账设备
     */
    fun getServiceDelete(id: Int): Observable<BaseEntity<Any>>

    /**
     * 意见反馈
     */
    fun addFeedback(content: String): Observable<BaseEntity<Any>>

    /**
     * 版本更新信息
     */
    fun getAppVersion(): Observable<BaseEntity<VersionUpdateVO>>


    /**
     * 发布供应 计算管币价格
     */
    fun getSupplyPrice(
        serverId: Int,
        startTime: String,
        endTime: String
    ): Observable<BaseEntity<Double>>

    /**
     * 添加银行卡
     */
    fun addBankCard(dto: AddBankDTO): Observable<BaseEntity<Any>>

    /**
     * 获取服务设备列表
     */
    fun getBankCardList(
        page: Int,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<BankListVO>>>

    /**
     * 解绑银行卡
     */
    fun deleteBank(id: Int): Observable<BaseEntity<Any>>

    /**
     * 获取钱包记录列表
     */
    fun getWalletBillList(
        income: String = "",
        page: Int,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<BalanceRecordVO>>>

    /**
     * 提现
     */
    fun getWithdraw(dto: WithdrawDTO): Observable<BaseEntity<Any>>

    /**
     * 获取提现明细
     */
    fun findWithdrawByPage(
        status: Int,
        page: Int,
        limit: Int = 10
    ): Observable<BaseEntity<Ipage<WithdrawRecordVO>>>

    /**
     * 发布需求 计算管币价格
     */
    fun getNeedPrice(
    ): Observable<BaseEntity<Double>>

    /**
     * 供应询价 获取管币价格
     */
    fun getInquiryPrice(
    ): Observable<BaseEntity<Double>>

    /**
     * 需求报价 获取管币价格
     */
    fun getNeedQuote(
    ): Observable<BaseEntity<Double>>

    /**
     * 充值套餐列表
     */
    fun getRechargeList(
    ): Observable<BaseEntity<List<RechargeInfoVO>>>

    /**
     * 微信充值
     */
    fun sumitWxRecharge(
        id: Int
    ): Observable<BaseEntity<WechatResponse>>



    fun getAdvertisingIntro(
        id: Int
    ): Observable<BaseEntity<AgreementVO>>

    fun getRongContact(name: String): Observable<BaseEntity<List<ContactUserVo>>>

    /**
     * 融云账号所有用户信息列表
     */
    fun getRongAllContact(): Observable<BaseEntity<List<ContactUserVo>>>

    fun getRyPersonalInfo(id: Int): Observable<BaseEntity<RyUserVo>>

    /**
     * 获取融云组织架构列表
     */
    fun getRongOrganize(): Observable<BaseEntity<List<OrganizeDeptRes>>>

    /**
     * 创建群聊
     */
    fun getCreateGroup(dto: CreateGroupDTO): Observable<BaseEntity<Any>>

    /**
     * 创建群聊
     */
    fun getTaskCreateGroup(dto: TaskCreateGroupDTO): Observable<BaseEntity<Any>>

    /**
     * 获取融云群组列表
     */
    fun getRongGroupList(): Observable<BaseEntity<List<RongGroupVO>>>

    /**
     * 添加行政区域负责区域
     */
    fun addAdministrative(dto: AddAdministrativeDTO): Observable<BaseEntity<Any>>

    fun getAppServiceId(): Observable<BaseEntity<ContactUserVo>>

    fun getExamineOperatorList(
        status: Int,
        page: Int = 1,
        limit: Int = 10,
    ): Observable<BaseEntity<Ipage<ExamineOperatorVo>>>

    fun getExamineRecordList(
        status: Int,
        page: Int = 1,
        limit: Int = 10,
    ): Observable<BaseEntity<Ipage<ExamineRecordVo>>>

    fun audit(id: Int,status: Int,remark : String?=""): Observable<BaseEntity<Any>>

    fun applyInfo(id: String):Observable<BaseEntity<ExamineInfoVo>>

    fun groupListInfo(id: String):Observable<BaseEntity<GroupDetailVo>>
    fun exitGroup(id: Int):Observable<BaseEntity<Any>>

    fun addGroup(groupId: String,userIds:String):Observable<BaseEntity<Any>>
    fun quitGroup(groupId: String,userIds:String):Observable<BaseEntity<Any>>
    fun cleanGroup(groupId: Int):Observable<BaseEntity<Any>>

    fun getRongContact(groupId: String,userName: String): Observable<BaseEntity<List<ContactUserVo>>>
    fun groupReport(dto : ReqGroupReportDTO): Observable<BaseEntity<Any>>
    fun userReport(dto : ReqUserReportDTO): Observable<BaseEntity<Any>>

    fun submitAliPayRecharge(rechargeId: Int): Observable<BaseEntity<String>>
}